int maxProfit(int* prices, int pricesSize)
{
    int min = 100000;
    int max = 0;
    for (int i = 0; i < pricesSize; i++)
    {
        int tmp = prices[i] - min;
        min = min < prices[i] ? min : prices[i];
        max = max > tmp ? max : tmp;
    }
    return max;
}